package com.example.controller;

import com.example.mapper.FileMapper;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * @BelongsProject: drools
 * @BelongsPackage: com.example.controller
 * @Author: dyz
 * @CreateTime: 16:38
 * @Version: 1.0
 */
@Component
public class droolsrun  implements Runnable{

    static public Rundrools rundrools;
    @Autowired
    public void rundrools(Rundrools rundrools) {
        droolsrun.rundrools = rundrools;
    }
    static public MaintainDrools maintainDrools;
    @Autowired
    public void rundrools(MaintainDrools maintainDrools) {
        droolsrun.maintainDrools = maintainDrools;
    }
//    static public HashMap<String, Thread> threadHashMap;
//    @Autowired
//    public void rundrools(HashMap<String, Thread> threadHashMap) {
//        droolsrun.threadHashMap = threadHashMap;
//    }
    @SneakyThrows
    @Override
    public void run() {
        rundrools.updatekieHepler();
        maintainDrools.updatekieHepler();
//        HashMap<String, Thread> threadHashMap1 = droolsrun.threadHashMap;
//        for (String s : threadHashMap1.keySet()) {
//            Thread thread = threadHashMap.get(s);
//            thread.stop();
//        }


    }
}
